﻿using UnityEngine;

namespace Miao
{
    public abstract class TimerBehaviour : MonoBehaviour
    {
        abstract public float timer { get; }
        private float casheTime;
        private void Update()
        {
            casheTime += Time.deltaTime;
            if (casheTime > timer)
            {
                casheTime = 0;
                TimeUpdate();
            }
        }
        protected abstract void TimeUpdate();
    }
}
